package helper;


import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.widget.EditText;
 
public class ContinueExcerciseDialogFragment extends DialogFragment {
 
    private OnAlertDialogClickListener mListener;
	private EditText mEditText;  
       
    @Override
    public Dialog onCreateDialog(Bundle sis) {
        Bundle bundle = getArguments();
        String posText = bundle.getString("positive");
        String negText = bundle.getString("negative");
        String neuText = bundle.getString("neutral");
        String title = bundle.getString("title");
        String message = bundle.getString("message");
        
 
        mListener = (OnAlertDialogClickListener) getActivity();
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 
       
        if(negText!=null)
        {
            builder.setNegativeButton(negText, new OnClickListener() {
 
                public void onClick(DialogInterface dialog, int which) {
                    mListener.onNegativeClick(dialog);
 
                }
            });
        }
        if(posText!=null)
        {
            builder.setPositiveButton(posText, new OnClickListener() {
 
                public void onClick(DialogInterface dialog, int which) {
                    mListener.onPositiveClick(dialog);
                }
            });
        }
        if(neuText!=null)
        {
            builder.setNeutralButton(neuText, new OnClickListener() {
 
                public void onClick(DialogInterface dialog, int which) {
                    mListener.onNeutralClick(dialog);
                }
            });
        }
        builder.setMessage(message);
        builder.setTitle(title);
        return builder.create();
 
    }
}
